package com.vue.designPatterns.decorator;

/**
 * Created by Administrator on 2019/3/14.
 * 装饰者,与被装饰者实现同一个接口
 * 持有被装饰者的实例
 */
public class Decorator implements Sourceable {

    private Sourceable source;

    public Decorator (Sourceable source) {
        super();
        this.source = source;
    }

    @Override
    public void method() {

        System.out.println("原始方法前");
        source.method();
        System.out.println("原始方法后");

    }
}
